
import './styles/Nabbar.less'
import routeBack from '@/assets/images/back.png'
import { useNavigate } from "react-router-dom"


function Nabbar ({ title, children }:{title:string, chilren:React.ReactNode}) {
  const navigate = useNavigate()

  function handlerBack() {
    navigate(-1)
  }

  return (
    <div className="titleBar flex  items-center  place-content-center">
      <img src={routeBack} alt="" className='routeBack' onClick={handlerBack}/>
      <div className="title">{ title }</div>
      <div className="right">
        {children || <div></div>}
      </div>
    </div>
  )

}


export default Nabbar;